-- GENERATED SPELL FOR [Illidari Dreadlord] --


function spell0_21166(pUnit, Event) --@Mind Blast,n/a--
pUnit:FullCastSpellOnTarget(17287,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21166', 1500, 1)
end

function spell1_21166(pUnit, Event) --@Psychic Scream,Self--
pUnit:FullCastSpellOnTarget(13704,pUnit)
pUnit:RegisterEvent('Sorts_21166', 6346, 1)
end

function spell2_21166(pUnit, Event) --@Sleep,n/a--
pUnit:FullCastSpellOnTarget(12098,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21166', 21000, 1)
end

function Sorts_21166(pUnit, Event)
local choix_sorts_21166 = math.random(0, 2)
if choix_sorts_21166 == 0 then
pUnit:RegisterEvent('spell0_21166', 1, 1)
end
if choix_sorts_21166 == 1 then
pUnit:RegisterEvent('spell1_21166', 1, 1)
end
if choix_sorts_21166 == 2 then
pUnit:RegisterEvent('spell2_21166', 1, 1)
end
end

function mob21166_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21166', math.random(1500, 3000), 1)
end

function mob21166_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21166_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21166_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21166, 1, 'mob21166_Action')
RegisterUnitEvent(21166, 2, 'mob21166_Leave')
RegisterUnitEvent(21166, 3, 'mob21166_Kill')
RegisterUnitEvent(21166, 4, 'mob21166_Die')
